#    This file is part of SRIS.
#
# 	 SRIS is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    SRIS is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with SRIS.  If not, see <http://www.gnu.org/licenses/>.
#
#    Copyright 2011 David Irvine
#

from sris.models import *
from django.contrib import admin

class FileSystemInline(admin.StackedInline):
	model=FileSystem
	extra=3

class ScannerAdmin(admin.ModelAdmin):
    inlines=[FileSystemInline]

admin.site.register(FileSystem)
admin.site.register(Scanner, ScannerAdmin)

class VFSExtendedInfoInline(admin.StackedInline):
	model=VFSExtendedInfo
	extra=0

class ScansAdmin(admin.ModelAdmin):
	list_display = ('FileSystem', 'ts', 'state','filesScanned','filesUnread','vfsSizeG',)
	inlines=[VFSExtendedInfoInline]

admin.site.register(Scan, ScansAdmin)


class BucketAdmin(admin.ModelAdmin):
	list_display = ('Scan','globalRoot', 'userName', 'groupName', 'aTime','mTime','cTime','size','docType','totalFiles','totalSize')
admin.site.register(Bucket,BucketAdmin)

class Fileadmin(admin.ModelAdmin):
	list_display = ('Bucket', 'globalPath', 'userName', 'size','accessTime','modificationTime', 'creationTime')
admin.site.register(ScannedFile,Fileadmin)

